﻿Imports System.IO
Imports DCM.DCM_Enum
Imports HPSocketCS


Public Class DCM_ServerHPExtData
    Public ConnID As IntPtr
    Public FF As DCM.DCM_Enum.Enum_URL_调用服务器方法
    Public YaSuoFangShi As Enum_CS_数据压缩方式
    Public Headers As List(Of THeader)
    Public Data As Object
    Public ErrorMessage As String = ""
    Public FileStream_WriteToServer As FileStream
    Public MemoryStream As MemoryStream
    Public NeedSendResponse As Boolean = True '是否不发送反馈消息结构体, 例如下载文件成功不需要反馈消息
    Public Sending_BuffCount As Long
    Public User_IP As String
    Public User_Port As UShort
    Public User_Agent As String
    Public 当计算完成后是否立即断开 As Boolean = False
    Public ClientSocketPtr As IntPtr
    Public a_连接位置 As Enum_连接位置 = Enum_连接位置.HeadersComplete
    Public a_StartTime As Date = Now
    Public a_用户名 As String = "未知"
    Public a_用户ID As String = "未知"
    Public a_操作内容 As String = "未知"
    Public a_系统开机时间 As Date = CDate("0001-01-01")
    Public a_系统空闲时长Long As Long = 0
    Public a_系统空闲状态 As Boolean = False
    Public IsWebSocket As Boolean = False
    Public WSConnectType As Enum_WS_ConnectType = Enum_WS_ConnectType.None
    Public WSUserInfo As DCM_HPServer.Struct_WSUser_Info
    Public Sub New(ErrorMessage As String)
        Me.ErrorMessage = ErrorMessage
    End Sub
    Public Sub New()
    End Sub
    Public Function GetHeaderStr(NameStr As String) As String
        If IsNothing(Headers) Then Return ""
        For Each item As THeader In Headers
            If item.Name = NameStr Then Return item.Value
        Next
        Return ""
    End Function
End Class
Public Enum Enum_连接位置
    HeadersComplete = 0
    PointerDataBody = 1
    OnMessageComplete_Start = 2
    OnMessageComplete_调用方法_End = 3
    OnMessageComplete_End = 4
End Enum